<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>热词</title>
	<script src="../../components/echarts-4.0.4.min.js"></script>
    <style>
        body,html{
            padding: 0;
            margin: 0;
			background:#0A0F23;
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
	<div style="width: 100%;height: 100%;" id="turnover"></div>
</body>
<script>
    var pieChart = echarts.init(document.getElementById('turnover'));
    var data = [	{value: 642,
		name: "西安交通大学"},
		{value: 575,
		name: "西安建筑科技大学"},
		{value: 512,
		name: "西北工业大学"},
		{value: 419,
		name: "西北农林科技大学"},
		{value: 363,
		name: "第四军医大学西京医院"},
		{value: 313,
		name: "第四军医大学唐都医院"},
		{value: 218,
		name: "西北大学"},
		{value: 192,
		name: "西安交通大学医学院"},
		{value: 179,
		name: "西安工业大学"},
		{value: 	177,
		name: "延安大学西安创新学院"},
	];
    var pieOption = {
        title: {
            text: '专家工作单位',
            left: 'center',
            top: "5%",
            textStyle: {
                color: '#fff',
                fontSize: 22
            }
        },
        color: ['#0179c4','#0097db','#00a3ac','#029f85','#009f5c','#81bd41','#f44a4a','#ed5f05', '#f29806', '#fdc901','#fdf100','#c0d528'],
        legend: {
            left: '10%',
            top: '15%',
            orient: 'vertical',
            itemGap: 12, //图例每项之间的间隔
            itemWidth: 10,
            itemHeight: 10,
            icon: 'rect',
            data: ['西安交通大学','西安建筑科技大学','西北工业大学','西北农林科技大学','第四军医大学西京医院','第四军医大学唐都医院','西北大学','西安交通大学医学院','西安工业大学','延安大学西安创新学院'],
            textStyle: {
                color: '#fff',
                fontSize: 16
            }
        },
        grid: {
            top: '10%',
            left: '10%',
            bottom: '5%',
            right: '10%',
            containLabel: true
        },
        series: [{
            type: 'pie',
            clockwise: false, //饼图的扇区是否是顺时针排布
            minAngle: 15, //最小的扇区角度（0 ~ 360）
            radius: ['20%', '50%'],
            center: ['65%', '60%'], //饼图的中心（圆心）坐标
            avoidLabelOverlap: true, ////是否启用防止标签重叠
            itemStyle: { //图形样式
                normal: {
                    borderColor: '#fff',
                    borderWidth: 1
                }
            },
            label: { //标签的位置
                normal: {
                    show: true,
                    position: 'inside', //标签的位置
                    formatter: "{d}%",
                    textStyle: {
                        color: '#fff'
                    }
                }
            },
            emphasis: {
                show: true,
                textStyle: {
                    fontWeight: 'bold'
                }
            },
            data: data
        }]
    };

    var currentIndex = -1;
    var timer1 = setInterval(function() {
      var dataLen = pieOption.series[0].data.length;
      // 取消之前高亮的图形
      pieChart.dispatchAction({
        type: 'downplay',
        seriesIndex: 0,
        dataIndex: currentIndex
      });
      currentIndex = (currentIndex + 1) % dataLen;
      // 高亮当前图形
      pieChart.dispatchAction({
        type: 'highlight',
        seriesIndex: 0,
        dataIndex: currentIndex
      });
    }, 1000);
    pieChart.setOption(pieOption);
</script>
</html>